import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginHomeView from "@/views/LoginHomeView";
import BookStoreHomeView from "@/views/bookstore/BookStoreHomeView";

Vue.use(VueRouter)

const routes = [
  {
    path: '/about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/reg',
    component: () => import( '../views/RegisterView.vue')
  },
  {
    path: '/login',
    component: () => import('../views/LoginHomeView'),
    children:[
      {
        path: '/account-login',
        component: () => import( '../views/AccountLoginView.vue')
      },
      {
        path: '/phone-login',
        component: () => import( '../views/PhoneLoginView.vue')
      }
    ]
  },
  {
    path: '/admin-login',
    component: () => import('../views/adminSystem/AdminLoginView')
  },
  {
    path: '/NavigationHome',
    component: () => import( '../views/NavigationHomeView.vue')
  },
  {
    path: '/NavigationChild',
    component: () => import( '../views/NavigationChildView.vue')
  },

  {
    path: '/personal-center',
    component: () => import('../views/PersonalCenterView'),
    children: [
      {
        path: '/my-info',
        component: () => import('../views/PersonalInfoView')
      },
      {
        path: '/update-info',
        component: () => import('../views/UpdateMyInfoView')
      }
    ]
  },
  {
    path: '/student-bookstore',
    component: BookStoreHomeView,
    redirect:'/student-bookstore/index',
    children: [
      {
        path: 'index',
        component: () => import('../views/bookstore/HomePageView')
      },
      {
        path: 'theme',
        component: () => import('../views/bookstore/classfication/ThemePublished')
      },
      {
        path: 'optimize',
        component: () => import('../views/bookstore/classfication/Optimization')
      },
      {
        path: 'examine',
        component: () => import('../views/bookstore/classfication/Examination')
      },
      {
        path: 'customize',
        component: () => import('../views/bookstore/classfication/Customization')
      },
      {
        path: 'newtimes',
        component: () => import('../views/bookstore/classfication/NewClassical')
      },
      {
        path: 'book-detail',
        component: () => import('../views/bookstore/classfication/BookDetail')
      },

    ]
  },
  {
    path: '/sys-admin',
    component: () => import('../views/adminSystem/AdminHomeView.vue'),
    redirect:'/sys-admin/index',
    children: [
      {
        path: 'index',
        component: () => import('../views/adminSystem/AdminIndexView.vue')
      },
      {
        path: 'admin/add-new',
        component: () => import('../views/adminSystem/authority/AdminAddNewView')
      },
      {
        path: 'admin/list',
        component: () => import('../views/adminSystem/authority/AdminListView')
      },
      {
        path: 'user/list',
        component: () => import('../views/adminSystem/authority/UserListView')
      },
      {
        path: 'category/add-new',
        component: () => import('../views/adminSystem/category/CategoryAddNewView')
      },
      {
        path: 'category/list',
        component: () => import('../views/adminSystem/category/CategoryListView')
      },
      {
        path: 'navigation/add-new',
        component: () => import('../views/adminSystem/category/NavigationAddNewView')
      },
      {
        path: 'navigation/list',
        component: () => import('../views/adminSystem/category/NavigationListView')
      },
      {
        path: 'album/add-new',
        component: () => import('../views/adminSystem/product/AlbumAddNewView')
      },
      {
        path: 'album/list',
        component: () => import('../views/adminSystem/product/AlbumListView')
      },
      {
        path: 'attribute/add-new',
        component: () => import('../views/adminSystem/product/AttributeAddNewView')
      },
      {
        path: 'attribute/list',
        component: () => import('../views/adminSystem/product/AttributeListView')
      },
      {
        path: 'product/spu-add-new',
        component: () => import('../views/adminSystem/product/SpuAddNewView')
      },
      {
        path: 'product/spu-management',
        component: () => import('../views/adminSystem/product/SpuManagementView')
      },
      {
        path: 'orders/management',
        component: () => import('../views/adminSystem/orders/OrderManagementView')
      },
      {
        path: 'account/management',
        component: () => import('../views/adminSystem/account/AccountManageView')
      },
      {
        path: 'banner/add-new',
        component: () => import('../views/adminSystem/activity/BannerAddNewView')
      },
      {
        path: 'banner/list',
        component: () => import('../views/adminSystem/activity/BannerListView')
      },
      {
        path: 'activity/add-new',
        component: () => import('../views/adminSystem/activity/ActivityAddNewView')
      },
      {
        path: 'activity/list',
        component: () => import('../views/adminSystem/activity/ActivityListView')
      },
      {
        path: 'announcement/add-new',
        component: () => import('../views/adminSystem/activity/AnnouncementAddNew')
      },
      {
        path: 'announcement/list',
        component: () => import('../views/adminSystem/activity/AnnouncementList')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
